const { projectAggregator } = require('../src/project-aggregator');

// 设置运行模式
const isProduction = process.env.NODE_ENV === 'production';
projectAggregator.setMode(isProduction ? 'production' : 'development');

// 显示简洁结构
if (!isProduction) {
  console.log('Project Structure:');
  console.dir(projectAggregator.getSimplifiedStructure(), { depth: 3 });
}

// 启动项目
try {
  projectAggregator.runProject();
  
  if (!isProduction) {
    console.log(`
Development Tips:
- Use "npm run compat:tree" to rebuild compatibility layer
- Use "npm run clean:compat" to clean up old versions
- Use "npm start:prod" for production mode
`);
  }
} catch (error) {
  console.error('Failed to start project:', error.message);
  process.exit(1);
}